// CircuitObjActiveX.cpp : Implementation of CCircuitObjActiveXApp and DLL registration.

#include "stdafx.h"
#include "CircuitObjActiveX.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


CCircuitObjActiveXApp theApp;

const GUID CDECL _tlid = { 0x57396FEE, 0x1AC1, 0x4905, { 0xA8, 0x5E, 0x67, 0x91, 0xD5, 0x99, 0x97, 0x7 } };
const WORD _wVerMajor = 1;
const WORD _wVerMinor = 0;



// CCircuitObjActiveXApp::InitInstance - DLL initialization

BOOL CCircuitObjActiveXApp::InitInstance()
{
	BOOL bInit = COleControlModule::InitInstance();

	if (bInit)
	{
		//InitCommonControls();

		INITCOMMONCONTROLSEX InitCtrls;
		InitCtrls.dwSize = sizeof(InitCtrls);
		// Set this to include all the common control classes you want to use
		// in your application.
		InitCtrls.dwICC = ICC_WIN95_CLASSES;
		InitCommonControlsEx(&InitCtrls);
		// TODO: Add your own module initialization code here.

		AfxEnableControlContainer();
	}

	return bInit;
}



// CCircuitObjActiveXApp::ExitInstance - DLL termination

int CCircuitObjActiveXApp::ExitInstance()
{
	// TODO: Add your own module termination code here.

	return COleControlModule::ExitInstance();
}



// DllRegisterServer - Adds entries to the system registry

STDAPI DllRegisterServer(void)
{
	AFX_MANAGE_STATE(_afxModuleAddrThis);

	if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
		return ResultFromScode(SELFREG_E_TYPELIB);

	if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
		return ResultFromScode(SELFREG_E_CLASS);

	return NOERROR;
}



// DllUnregisterServer - Removes entries from the system registry

STDAPI DllUnregisterServer(void)
{
	AFX_MANAGE_STATE(_afxModuleAddrThis);

	if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
		return ResultFromScode(SELFREG_E_TYPELIB);

	if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
		return ResultFromScode(SELFREG_E_CLASS);

	return NOERROR;
}
